Propagate isParameterType through input-only types #393
Draft
braeden wants to merge 3 commits into
Draft
Conversation
Generate changelog in
|
Walk all endpoints to classify each referenced type as input-position, output-position, or both (transitively through fields/members/aliases). Types reachable only from inputs are emitted with isParameterType=true, so list/set fields become ReadonlyArray<T>. Types used in both positions or output-only keep the existing shape. Stacks on top of #392 (readonly endpoint params), which provides the isParameterType -> ReadonlyArray<T> behaviour in resolveTsType. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bbc12ff to
0286d2b
Compare
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FLUP on #392
Apply the approach in #392 recursively to all types that are solely marked as inputs. Again, this is not an API break since it widens the contract for consumers interacting with TS clients.
This is still not as full-fledged as as the
readonlyInterfacesgradle flag & requires another recursive pass through the types.Testing
In the large service I ran this against (across 3x different modules), we converted ~25% of the array types emitted in the repo into
ReadonlyArray, this is a big difference for the surface area of callers and the need to mutably cast.